using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VKDMVV
    {
        public DataRow Convert2KDMVV(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryKDMVV(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["KDMVMANDANT"] = " ".PadRight(2 ); 
         dwReturn["KDMVVTLNR"] = " ".PadRight(4 ); 
         dwReturn["KDMVAENZL"] = " ".PadRight(0 ); 
         dwReturn["KDMVAENB"] = " ".PadRight(8 ); 
         dwReturn["KDMVAEND"] = " ".PadRight(0 ); 
         dwReturn["KDMVNEUB"] = " ".PadRight(8 ); 
         dwReturn["KDMVNEUD"] = " ".PadRight(0 ); 
         dwReturn["KDMVKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["KDMVADRSL"] = " ".PadRight(8 ); 
         dwReturn["KDMVWZEIT"] = " ".PadRight(0 ); 
         dwReturn["KDMVANSPNA1"] = " ".PadRight(8 ); 
         dwReturn["KDMVANSPNA2"] = " ".PadRight(8 ); 
         dwReturn["KDMVVERWEND"] = " ".PadRight(55 ); 
         dwReturn["KDMVAMUSTER"] = " ".PadRight(0 ); 
         dwReturn["KDMVFORMAT"] = " ".PadRight(1 ); 
         dwReturn["KDMVPRO"] = " ".PadRight(1 ); 
         dwReturn["KDMVPZEUGNIS"] = " ".PadRight(1 ); 
         dwReturn["KDMVANZ1"] = " ".PadRight(0 ); 
         dwReturn["KDMVART1"] = " ".PadRight(3 ); 
         dwReturn["KDMVTFORMAT1"] = " ".PadRight(1 ); 
         dwReturn["KDMVETK1"] = " ".PadRight(8 ); 
         dwReturn["KDMVSA1"] = " ".PadRight(1 ); 
         dwReturn["KDMVADRSL11"] = " ".PadRight(8 ); 
         dwReturn["KDMVADRSL21"] = " ".PadRight(8 ); 
         dwReturn["KDMVVART1"] = " ".PadRight(3 ); 
         dwReturn["KDMVSPED1"] = " ".PadRight(3 ); 
         dwReturn["KDMVBISH1"] = " ".PadRight(0 ); 
         dwReturn["KDMVANZ2"] = " ".PadRight(0 ); 
         dwReturn["KDMVART2"] = " ".PadRight(3 ); 
         dwReturn["KDMVTFORMAT2"] = " ".PadRight(1 ); 
         dwReturn["KDMVETK2"] = " ".PadRight(8 ); 
         dwReturn["KDMVSA2"] = " ".PadRight(1 ); 
         dwReturn["KDMVADRSL12"] = " ".PadRight(8 ); 
         dwReturn["KDMVADRSL22"] = " ".PadRight(8 ); 
         dwReturn["KDMVVART2"] = " ".PadRight(3 ); 
         dwReturn["KDMVSPED2"] = " ".PadRight(3 ); 
         dwReturn["KDMVBISH2"] = " ".PadRight(0 ); 
         dwReturn["KDMVANZ3"] = " ".PadRight(0 ); 
         dwReturn["KDMVART3"] = " ".PadRight(3 ); 
         dwReturn["KDMVTFORMAT3"] = " ".PadRight(1 ); 
         dwReturn["KDMVETK3"] = " ".PadRight(8 ); 
         dwReturn["KDMVSA3"] = " ".PadRight(1 ); 
         dwReturn["KDMVADRSL13"] = " ".PadRight(8 ); 
         dwReturn["KDMVADRSL23"] = " ".PadRight(8 ); 
         dwReturn["KDMVVART3"] = " ".PadRight(3 ); 
         dwReturn["KDMVSPED3"] = " ".PadRight(3 ); 
         dwReturn["KDMVBISH3"] = " ".PadRight(0 ); 
         dwReturn["KDMVANZ4"] = " ".PadRight(0 ); 
         dwReturn["KDMVART4"] = " ".PadRight(3 ); 
         dwReturn["KDMVTFORMAT4"] = " ".PadRight(1 ); 
         dwReturn["KDMVETK4"] = " ".PadRight(8 ); 
         dwReturn["KDMVSA4"] = " ".PadRight(1 ); 
         dwReturn["KDMVADRSL14"] = " ".PadRight(8 ); 
         dwReturn["KDMVADRSL24"] = " ".PadRight(8 ); 
         dwReturn["KDMVVART4"] = " ".PadRight(3 ); 
         dwReturn["KDMVSPED4"] = " ".PadRight(3 ); 
         dwReturn["KDMVBISH4"] = " ".PadRight(0 ); 
         dwReturn["KDMVBEM1"] = " ".PadRight(70 ); 
         dwReturn["KDMVBEM2"] = " ".PadRight(70 ); 
         dwReturn["KDMVGESSTA1"] = " ".PadRight(1 ); 
         dwReturn["KDMVGESSTA2"] = " ".PadRight(1 ); 
         dwReturn["KDMVGESSTA3"] = " ".PadRight(1 ); 
         dwReturn["KDMVGESSTA4"] = " ".PadRight(1 ); 
         dwReturn["KDMVGESSTA5"] = " ".PadRight(1 ); 
         dwReturn["KDMVEINZSTA1"] = " ".PadRight(1 ); 
         dwReturn["KDMVEINZSTA2"] = " ".PadRight(1 ); 
         dwReturn["KDMVEINZSTA3"] = " ".PadRight(1 ); 
         dwReturn["KDMVEINZSTA4"] = " ".PadRight(1 ); 
         dwReturn["KDMVEINZSTA5"] = " ".PadRight(1 ); 
         dwReturn["KDMVFILLER"] = " ".PadRight(18 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapKDMVV(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveKDMVV(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryKDMVV(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapKDMVV(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertKDMVV(dwLocal, ITXDBVERSION);
            }
            UpdateKDMVV(dwLocal);
        }
        public void InsertKDMVV(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO KDMVV(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryKDMVV(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM KDMVV WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM KDMVV  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "KDMVV";
            Return = Result;
            return Return;
        }
        public void DeleteKDMVV(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM KDMVV   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateKDMVV(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE KDMVV SET "
                    +"KDMVMANDANT= :KDMVMANDANT,"
                    +"KDMVVTLNR= :KDMVVTLNR,"
                    +"KDMVAENZL= :KDMVAENZL,"
                    +"KDMVAENB= :KDMVAENB,"
                    +"KDMVAEND= :KDMVAEND,"
                    +"KDMVNEUB= :KDMVNEUB,"
                    +"KDMVNEUD= :KDMVNEUD,"
                    +"KDMVKUNDNR= :KDMVKUNDNR,"
                    +"KDMVADRSL= :KDMVADRSL,"
                    +"KDMVWZEIT= :KDMVWZEIT,"
                    +"KDMVANSPNA1= :KDMVANSPNA1,"
                    +"KDMVANSPNA2= :KDMVANSPNA2,"
                    +"KDMVVERWEND= :KDMVVERWEND,"
                    +"KDMVAMUSTER= :KDMVAMUSTER,"
                    +"KDMVFORMAT= :KDMVFORMAT,"
                    +"KDMVPRO= :KDMVPRO,"
                    +"KDMVPZEUGNIS= :KDMVPZEUGNIS,"
                    +"KDMVANZ1= :KDMVANZ1,"
                    +"KDMVART1= :KDMVART1,"
                    +"KDMVTFORMAT1= :KDMVTFORMAT1,"
                    +"KDMVETK1= :KDMVETK1,"
                    +"KDMVSA1= :KDMVSA1,"
                    +"KDMVADRSL11= :KDMVADRSL11,"
                    +"KDMVADRSL21= :KDMVADRSL21,"
                    +"KDMVVART1= :KDMVVART1,"
                    +"KDMVSPED1= :KDMVSPED1,"
                    +"KDMVBISH1= :KDMVBISH1,"
                    +"KDMVANZ2= :KDMVANZ2,"
                    +"KDMVART2= :KDMVART2,"
                    +"KDMVTFORMAT2= :KDMVTFORMAT2,"
                    +"KDMVETK2= :KDMVETK2,"
                    +"KDMVSA2= :KDMVSA2,"
                    +"KDMVADRSL12= :KDMVADRSL12,"
                    +"KDMVADRSL22= :KDMVADRSL22,"
                    +"KDMVVART2= :KDMVVART2,"
                    +"KDMVSPED2= :KDMVSPED2,"
                    +"KDMVBISH2= :KDMVBISH2,"
                    +"KDMVANZ3= :KDMVANZ3,"
                    +"KDMVART3= :KDMVART3,"
                    +"KDMVTFORMAT3= :KDMVTFORMAT3,"
                    +"KDMVETK3= :KDMVETK3,"
                    +"KDMVSA3= :KDMVSA3,"
                    +"KDMVADRSL13= :KDMVADRSL13,"
                    +"KDMVADRSL23= :KDMVADRSL23,"
                    +"KDMVVART3= :KDMVVART3,"
                    +"KDMVSPED3= :KDMVSPED3,"
                    +"KDMVBISH3= :KDMVBISH3,"
                    +"KDMVANZ4= :KDMVANZ4,"
                    +"KDMVART4= :KDMVART4,"
                    +"KDMVTFORMAT4= :KDMVTFORMAT4,"
                    +"KDMVETK4= :KDMVETK4,"
                    +"KDMVSA4= :KDMVSA4,"
                    +"KDMVADRSL14= :KDMVADRSL14,"
                    +"KDMVADRSL24= :KDMVADRSL24,"
                    +"KDMVVART4= :KDMVVART4,"
                    +"KDMVSPED4= :KDMVSPED4,"
                    +"KDMVBISH4= :KDMVBISH4,"
                    +"KDMVBEM1= :KDMVBEM1,"
                    +"KDMVBEM2= :KDMVBEM2,"
                    +"KDMVGESSTA1= :KDMVGESSTA1,"
                    +"KDMVGESSTA2= :KDMVGESSTA2,"
                    +"KDMVGESSTA3= :KDMVGESSTA3,"
                    +"KDMVGESSTA4= :KDMVGESSTA4,"
                    +"KDMVGESSTA5= :KDMVGESSTA5,"
                    +"KDMVEINZSTA1= :KDMVEINZSTA1,"
                    +"KDMVEINZSTA2= :KDMVEINZSTA2,"
                    +"KDMVEINZSTA3= :KDMVEINZSTA3,"
                    +"KDMVEINZSTA4= :KDMVEINZSTA4,"
                    +"KDMVEINZSTA5= :KDMVEINZSTA5,"
                    +"KDMVFILLER= :KDMVFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("KDMVMANDANT", OracleType.NVarChar).Value = dwData["KDMVMANDANT"].ToString(); 
          or1.Parameters.Add("KDMVVTLNR", OracleType.NVarChar).Value = dwData["KDMVVTLNR"].ToString(); 
          or1.Parameters.Add("KDMVAENZL", OracleType.NVarChar).Value = dwData["KDMVAENZL"].ToString(); 
          or1.Parameters.Add("KDMVAENB", OracleType.NVarChar).Value = dwData["KDMVAENB"].ToString(); 
          or1.Parameters.Add("KDMVAEND", OracleType.NVarChar).Value = dwData["KDMVAEND"].ToString(); 
          or1.Parameters.Add("KDMVNEUB", OracleType.NVarChar).Value = dwData["KDMVNEUB"].ToString(); 
          or1.Parameters.Add("KDMVNEUD", OracleType.NVarChar).Value = dwData["KDMVNEUD"].ToString(); 
          or1.Parameters.Add("KDMVKUNDNR", OracleType.NVarChar).Value = dwData["KDMVKUNDNR"].ToString(); 
          or1.Parameters.Add("KDMVADRSL", OracleType.NVarChar).Value = dwData["KDMVADRSL"].ToString(); 
          or1.Parameters.Add("KDMVWZEIT", OracleType.NVarChar).Value = dwData["KDMVWZEIT"].ToString(); 
          or1.Parameters.Add("KDMVANSPNA1", OracleType.NVarChar).Value = dwData["KDMVANSPNA1"].ToString(); 
          or1.Parameters.Add("KDMVANSPNA2", OracleType.NVarChar).Value = dwData["KDMVANSPNA2"].ToString(); 
          or1.Parameters.Add("KDMVVERWEND", OracleType.NVarChar).Value = dwData["KDMVVERWEND"].ToString(); 
          or1.Parameters.Add("KDMVAMUSTER", OracleType.NVarChar).Value = dwData["KDMVAMUSTER"].ToString(); 
          or1.Parameters.Add("KDMVFORMAT", OracleType.NVarChar).Value = dwData["KDMVFORMAT"].ToString(); 
          or1.Parameters.Add("KDMVPRO", OracleType.NVarChar).Value = dwData["KDMVPRO"].ToString(); 
          or1.Parameters.Add("KDMVPZEUGNIS", OracleType.NVarChar).Value = dwData["KDMVPZEUGNIS"].ToString(); 
          or1.Parameters.Add("KDMVANZ1", OracleType.NVarChar).Value = dwData["KDMVANZ1"].ToString(); 
          or1.Parameters.Add("KDMVART1", OracleType.NVarChar).Value = dwData["KDMVART1"].ToString(); 
          or1.Parameters.Add("KDMVTFORMAT1", OracleType.NVarChar).Value = dwData["KDMVTFORMAT1"].ToString(); 
          or1.Parameters.Add("KDMVETK1", OracleType.NVarChar).Value = dwData["KDMVETK1"].ToString(); 
          or1.Parameters.Add("KDMVSA1", OracleType.NVarChar).Value = dwData["KDMVSA1"].ToString(); 
          or1.Parameters.Add("KDMVADRSL11", OracleType.NVarChar).Value = dwData["KDMVADRSL11"].ToString(); 
          or1.Parameters.Add("KDMVADRSL21", OracleType.NVarChar).Value = dwData["KDMVADRSL21"].ToString(); 
          or1.Parameters.Add("KDMVVART1", OracleType.NVarChar).Value = dwData["KDMVVART1"].ToString(); 
          or1.Parameters.Add("KDMVSPED1", OracleType.NVarChar).Value = dwData["KDMVSPED1"].ToString(); 
          or1.Parameters.Add("KDMVBISH1", OracleType.NVarChar).Value = dwData["KDMVBISH1"].ToString(); 
          or1.Parameters.Add("KDMVANZ2", OracleType.NVarChar).Value = dwData["KDMVANZ2"].ToString(); 
          or1.Parameters.Add("KDMVART2", OracleType.NVarChar).Value = dwData["KDMVART2"].ToString(); 
          or1.Parameters.Add("KDMVTFORMAT2", OracleType.NVarChar).Value = dwData["KDMVTFORMAT2"].ToString(); 
          or1.Parameters.Add("KDMVETK2", OracleType.NVarChar).Value = dwData["KDMVETK2"].ToString(); 
          or1.Parameters.Add("KDMVSA2", OracleType.NVarChar).Value = dwData["KDMVSA2"].ToString(); 
          or1.Parameters.Add("KDMVADRSL12", OracleType.NVarChar).Value = dwData["KDMVADRSL12"].ToString(); 
          or1.Parameters.Add("KDMVADRSL22", OracleType.NVarChar).Value = dwData["KDMVADRSL22"].ToString(); 
          or1.Parameters.Add("KDMVVART2", OracleType.NVarChar).Value = dwData["KDMVVART2"].ToString(); 
          or1.Parameters.Add("KDMVSPED2", OracleType.NVarChar).Value = dwData["KDMVSPED2"].ToString(); 
          or1.Parameters.Add("KDMVBISH2", OracleType.NVarChar).Value = dwData["KDMVBISH2"].ToString(); 
          or1.Parameters.Add("KDMVANZ3", OracleType.NVarChar).Value = dwData["KDMVANZ3"].ToString(); 
          or1.Parameters.Add("KDMVART3", OracleType.NVarChar).Value = dwData["KDMVART3"].ToString(); 
          or1.Parameters.Add("KDMVTFORMAT3", OracleType.NVarChar).Value = dwData["KDMVTFORMAT3"].ToString(); 
          or1.Parameters.Add("KDMVETK3", OracleType.NVarChar).Value = dwData["KDMVETK3"].ToString(); 
          or1.Parameters.Add("KDMVSA3", OracleType.NVarChar).Value = dwData["KDMVSA3"].ToString(); 
          or1.Parameters.Add("KDMVADRSL13", OracleType.NVarChar).Value = dwData["KDMVADRSL13"].ToString(); 
          or1.Parameters.Add("KDMVADRSL23", OracleType.NVarChar).Value = dwData["KDMVADRSL23"].ToString(); 
          or1.Parameters.Add("KDMVVART3", OracleType.NVarChar).Value = dwData["KDMVVART3"].ToString(); 
          or1.Parameters.Add("KDMVSPED3", OracleType.NVarChar).Value = dwData["KDMVSPED3"].ToString(); 
          or1.Parameters.Add("KDMVBISH3", OracleType.NVarChar).Value = dwData["KDMVBISH3"].ToString(); 
          or1.Parameters.Add("KDMVANZ4", OracleType.NVarChar).Value = dwData["KDMVANZ4"].ToString(); 
          or1.Parameters.Add("KDMVART4", OracleType.NVarChar).Value = dwData["KDMVART4"].ToString(); 
          or1.Parameters.Add("KDMVTFORMAT4", OracleType.NVarChar).Value = dwData["KDMVTFORMAT4"].ToString(); 
          or1.Parameters.Add("KDMVETK4", OracleType.NVarChar).Value = dwData["KDMVETK4"].ToString(); 
          or1.Parameters.Add("KDMVSA4", OracleType.NVarChar).Value = dwData["KDMVSA4"].ToString(); 
          or1.Parameters.Add("KDMVADRSL14", OracleType.NVarChar).Value = dwData["KDMVADRSL14"].ToString(); 
          or1.Parameters.Add("KDMVADRSL24", OracleType.NVarChar).Value = dwData["KDMVADRSL24"].ToString(); 
          or1.Parameters.Add("KDMVVART4", OracleType.NVarChar).Value = dwData["KDMVVART4"].ToString(); 
          or1.Parameters.Add("KDMVSPED4", OracleType.NVarChar).Value = dwData["KDMVSPED4"].ToString(); 
          or1.Parameters.Add("KDMVBISH4", OracleType.NVarChar).Value = dwData["KDMVBISH4"].ToString(); 
          or1.Parameters.Add("KDMVBEM1", OracleType.NVarChar).Value = dwData["KDMVBEM1"].ToString(); 
          or1.Parameters.Add("KDMVBEM2", OracleType.NVarChar).Value = dwData["KDMVBEM2"].ToString(); 
          or1.Parameters.Add("KDMVGESSTA1", OracleType.NVarChar).Value = dwData["KDMVGESSTA1"].ToString(); 
          or1.Parameters.Add("KDMVGESSTA2", OracleType.NVarChar).Value = dwData["KDMVGESSTA2"].ToString(); 
          or1.Parameters.Add("KDMVGESSTA3", OracleType.NVarChar).Value = dwData["KDMVGESSTA3"].ToString(); 
          or1.Parameters.Add("KDMVGESSTA4", OracleType.NVarChar).Value = dwData["KDMVGESSTA4"].ToString(); 
          or1.Parameters.Add("KDMVGESSTA5", OracleType.NVarChar).Value = dwData["KDMVGESSTA5"].ToString(); 
          or1.Parameters.Add("KDMVEINZSTA1", OracleType.NVarChar).Value = dwData["KDMVEINZSTA1"].ToString(); 
          or1.Parameters.Add("KDMVEINZSTA2", OracleType.NVarChar).Value = dwData["KDMVEINZSTA2"].ToString(); 
          or1.Parameters.Add("KDMVEINZSTA3", OracleType.NVarChar).Value = dwData["KDMVEINZSTA3"].ToString(); 
          or1.Parameters.Add("KDMVEINZSTA4", OracleType.NVarChar).Value = dwData["KDMVEINZSTA4"].ToString(); 
          or1.Parameters.Add("KDMVEINZSTA5", OracleType.NVarChar).Value = dwData["KDMVEINZSTA5"].ToString(); 
          or1.Parameters.Add("KDMVFILLER", OracleType.NVarChar).Value = dwData["KDMVFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
